import java.util.Random;
import java.util.Scanner;
public class Text5 {
    public static void main(String[] args) {
        System.out.println("程序已启动");
        System.out.println("剪刀1、石头2、布3");
        Scanner input = new Scanner(System.in);
        Random random = new Random();
        String enter;
        int wincount = 0;
        int lostcount = 0;
        int drawcount = 0;
        for(int i=1;i<6;i++){
            System.out.println("第"+i+"局");
            System.out.println("你本次出的是：");
            enter = input.next();
            switch(random.nextInt(3)+1){ // [1,3]
                case 1:
                    System.out.println("剪刀");
                    if(enter.equals("剪刀")){
                        System.out.println("你俩平局");
                        drawcount++;
                    }
                    else if(enter.equals("石头")){
                        System.out.println("你赢了");
                        wincount++;
                    }
                    else if(enter.equals("布")){
                        System.out.println("你输了");
                        lostcount++;

                    }
                    else {
                        System.out.println("你出错了！");
                    }
                    break;
                case 2:
                    System.out.println("石头");
                    if(enter.equals("石头")){
                        System.out.println("你俩平局");
                        drawcount++;
                    }
                    else if(enter.equals("布")){
                        System.out.println("你赢了");
                        wincount++;
                    }
                    else if(enter.equals("剪刀")){
                        System.out.println("你输了");
                        lostcount++;
                    }
                    else {
                        System.out.println("你出错了！");
                    }
                    break;
                case 3:
                    System.out.println("布");
                    if(enter.equals("布")){
                        System.out.println("你俩平局");
                        drawcount++;
                    }
                    else if(enter.equals("剪刀")){
                        System.out.println("你赢了");
                        wincount++;
                    }
                    else if(enter.equals("石头")){
                        System.out.println("你输了");
                        lostcount++;
                    }
                    else {
                        System.out.println("你出错了！");
                    }
                    break;
                default:
                    System.out.println("程序有错");
            }
        }
        if(wincount>lostcount){
            System.out.println("呀呼~本次猜拳游戏你赢了！");
        }
        else if(wincount<lostcount){
            System.out.println("这次猜拳游戏你输了");
        }
        else{
            System.out.println("这次猜拳游戏平局了");
        }
    }
}
